DEFINITION FOR C MODULE Alerts ;

(*---------------------------------------------------------------------
|
|  Format of the alert error number:
|
|    +-+-------------+----------------+--------------------------------+
|    |D|  SubSysId   |	General Error |    SubSystem Specific Error    |
|    +-+-------------+----------------+--------------------------------+
|     1    7 bits	   8 bits		   16 bits
|
|		     D:  DeadEnd alert
|	      SubSysId:  indicates ROM subsystem number.
|	 General Error:  roughly indicates what the error was
|	Specific Error:  indicates more detail
|
----------------------------------------------------------------------*)

(*---------------------------------------------------------------------
|
|  Hardware/CPU specific alerts:  They may show without the 8 at the
|  front of the number.  These are CPU/68000 specific.	See 680x0
|  programmer's manuals for more details.
|
----------------------------------------------------------------------*)

CONST
  ACPU_BusErr	 = 080000002H ;	(* Hardware bus fault/access error    *)
  ACPU_AddressErr= 080000003H ;	(* Illegal address access (ie: odd)   *)
  ACPU_InstErr	 = 080000004H ;	(* Illegal instruction		      *)
  ACPU_DivZero	 = 080000005H ;	(* Divide by zero		      *)
  ACPU_CHK	 = 080000006H ;	(* Check instruction error	      *)
  ACPU_TRAPV	 = 080000007H ;	(* TrapV instruction error	      *)
  ACPU_PrivErr	 = 080000008H ;	(* Privilege violation error	      *)
  ACPU_Trace	 = 080000009H ;	(* Trace error			      *)
  ACPU_LineA	 = 08000000AH ;	(* Line 1010 Emulator error	      *)
  ACPU_LineF	 = 08000000BH ;	(* Line 1111 Emulator error	      *)
  ACPU_Format	 = 08000000EH ;	(* Stack frame format error	      *)
  ACPU_Spurious	 = 080000018H ;	(* Spurious interrupt error	      *)
  ACPU_AutoVec1	 = 080000019H ;	(* AutoVector Level 1 interrupt error *)
  ACPU_AutoVec2	 = 08000001AH ;	(* AutoVector Level 2 interrupt error *)
  ACPU_AutoVec3	 = 08000001BH ;	(* AutoVector Level 3 interrupt error *)
  ACPU_AutoVec4	 = 08000001CH ;	(* AutoVector Level 4 interrupt error *)
  ACPU_AutoVec5	 = 08000001DH ;	(* AutoVector Level 5 interrupt error *)
  ACPU_AutoVec6	 = 08000001EH ;	(* AutoVector Level 6 interrupt error *)
  ACPU_AutoVec7	 = 08000001FH ;	(* AutoVector Level 7 interrupt error *)

(*--------------------------------------------------------------------
|
|  General Alerts
|
|  For example: timer.device cannot open math.library would be  = 005038015
|
|	Alert(AN_TimerDev|AG_OpenLib|AO_MathLib) ;
|
----------------------------------------------------------------------*)

(*------ alert types --------*)
  AT_DeadEnd	 = 080000000H ;
  AT_Recovery	 = 000000000H ;

(*------ general purpose alert codes -------*)

  AG_NoMemory	 = 000010000H ;
  AG_MakeLib	 = 000020000H ;
  AG_OpenLib	 = 000030000H ;
  AG_OpenDev	 = 000040000H ;
  AG_OpenRes	 = 000050000H ;
  AG_IOError	 = 000060000H ;
  AG_NoSignal	 = 000070000H ;
  AG_BadParm	 = 000080000H ;
  AG_CloseLib	 = 000090000H ;	(* usually too many closes *)
  AG_CloseDev	 = 0000A0000H ;	(* or a mismatched close   *)
  AG_ProcCreate	 = 0000B0000H ;	(* Process creation failed *)

(*------ alert objects: --------*)
  AO_ExecLib	 = 000008001H ;
  AO_GraphicsLib = 000008002H ;
  AO_LayersLib	 = 000008003H ;
  AO_Intuition	 = 000008004H ;
  AO_MathLib	 = 000008005H ;
  AO_DOSLib	 = 000008007H ;
  AO_RAMLib	 = 000008008H ;
  AO_IconLib	 = 000008009H ;
  AO_ExpansionLib= 00000800AH ;
  AO_DiskfontLib = 00000800BH ;
  AO_UtilityLib	 = 00000800CH ;
  AO_KeyMapLib	 = 00000800DH ;

  AO_AudioDev	 = 000008010H ;
  AO_ConsoleDev	 = 000008011H ;
  AO_GamePortDev = 000008012H ;
  AO_KeyboardDev = 000008013H ;
  AO_TrackDiskDev= 000008014H ;
  AO_TimerDev	 = 000008015H ;

  AO_CIARsrc	 = 000008020H ;
  AO_DiskRsrc	 = 000008021H ;
  AO_MiscRsrc	 = 000008022H ;

  AO_BootStrap	 = 000008030H ;
  AO_Workbench	 = 000008031H ;
  AO_DiskCopy	 = 000008032H ;
  AO_GadTools	 = 000008033H ;
  AO_Unknown	 = 000008035H ;

(*--------------------------------------------------------------------
|
|   Specific Alerts:
|
|   For example:   exec.library -- corrupted memory list
|
|	    ALERT  AN_MemCorrupt ;8100 0005
|
----------------------------------------------------------------------*)

(*------ exec.library --------*)
  AN_ExecLib	  = 001000000H ;
  AN_ExcptVect	  = 001000001H ; (* 68000 exception vector checksum (obs.)  *)
  AN_BaseChkSum	  = 001000002H ; (* Execbase checksum (obs.)		    *)
  AN_LibChkSum	  = 001000003H ; (* Library checksum failure 		    *)

  AN_MemCorrupt	  = 081000005H ; (* Corrupt memory list detected in FreeMem *)
  AN_IntrMem	  = 081000006H ; (* No memory for interrupt servers         *)
  AN_InitAPtr	  = 001000007H ; (* InitStruct() of an APTR source (obs.)   *)
  AN_SemCorrupt	  = 001000008H ; (* A semaphore is in an illegal state      *)
				 (* at ReleaseSemaphore()                   *)

  AN_FreeTwice	  = 001000009H ; (* Freeing memory already freed            *)
  AN_BogusExcpt	  = 08100000AH ; (* illegal 68k exception taken (obs.)      *)
  AN_IOUsedTwice  = 00100000BH ; (* Attempt to reuse active IORequest       *)
  AN_MemoryInsane = 00100000CH ; (* Sanity check on memory list failed      *)
				 (* during AvailMem(MEMF_LARGEST)           *)

  AN_IOAfterClose = 00100000DH ; (* IO attempted on closed IORequest        *)
  AN_StackProbe	  = 00100000EH ; (* Stack appears to extend out of range    *)
  AN_BadFreeAddr  = 00100000FH ; (* Memory header not located. [ Usually an *)
				 (* invalid address passed to FreeMem() ]   *)

  AN_BadSemaphore = 001000010H ; (* An attempt was made to use the old      *)
				 (* message semaphores.			    *)

(*------ graphics.library --------*)
  AN_GraphicsLib  = 002000000H ;
  AN_GfxNoMem	  = 082010000H ; (* graphics out of memory		*)
  AN_GfxNoMemMspc = 082010001H ; (* MonitorSpec alloc, no memory	*)
  AN_LongFrame	  = 082010006H ; (* long frame, no memory		*)
  AN_ShortFrame	  = 082010007H ; (* short frame, no memory		*)
  AN_TextTmpRas	  = 002010009H ; (* text, no memory for TmpRas		*)
  AN_BltBitMap	  = 08201000AH ; (* BltBitMap, no memory		*)
  AN_RegionMemory = 08201000BH ; (* regions, memory not available	*)
  AN_MakeVPort	  = 082010030H ; (* MakeVPort, no memory		*)
  AN_GfxNewError  = 00200000CH ;
  AN_GfxFreeError = 00200000DH ;

  AN_GfxNoLCM	  = 082011234H ; (* emergency memory not available	*)

  AN_ObsoleteFont = 002000401H ; (* unsupported font description used	*)

(*------ layers.library --------*)
  AN_LayersLib	 = 003000000H  ;
  AN_LayersNoMem = 083010000H  ; (* layers out of memory		*)

(*------ intuition.library ------*)
  AN_Intuition	 = 004000000H ;
  AN_GadgetType	 = 084000001H ;	(* unknown gadget type 			*)
  AN_BadGadget	 = 004000001H ;	(* Recovery form of AN_GadgetType	*)
  AN_CreatePort	 = 084010002H ;	(* create port, no memory		*)
  AN_ItemAlloc	 = 004010003H ;	(* item plane alloc, no memory		*)
  AN_SubAlloc	 = 004010004H ;	(* sub alloc, no memory			*)
  AN_PlaneAlloc	 = 084010005H ;	(* plane alloc, no memory		*)
  AN_ItemBoxTop	 = 084000006H ;	(* item box top < RelZero		*)
  AN_OpenScreen	 = 084010007H ;	(* open screen, no memory		*)
  AN_OpenScrnRast= 084010008H ;	(* open screen, raster alloc, no memory *)
  AN_SysScrnType = 084000009H ;	(* open sys screen, unknown type	*)
  AN_AddSWGadget = 08401000AH ;	(* add SW gadgets, no memory		*)
  AN_OpenWindow	 = 08401000BH ;	(* open window, no memory		*)
  AN_BadState	 = 08400000CH ;	(* Bad State Return entering Intuition	*)
  AN_BadMessage	 = 08400000DH ;	(* Bad Message received by IDCMP	*)
  AN_WeirdEcho	 = 08400000EH ;	(* Weird echo causing incomprehension	*)
  AN_NoConsole	 = 08400000FH ;	(* couldn't open the Console Device	*)
  AN_NoISem	 = 004000010H ;	(* Intuition skipped obtaining a sem	*)
  AN_ISemOrder	 = 004000011H ;	(* Intuition obtained a sem in bad order*)

(*------ math.library ------*)
  AN_MathLib	 = 005000000H ;

(*------ dos.library -------*)
  AN_DOSLib	 = 007000000H ;
  AN_StartMem	 = 007010001H ; (* no memory at startup			  *)
  AN_EndTask	 = 007000002H ; (* EndTask didn't			  *)
  AN_QPktFail	 = 007000003H ; (* Qpkt failure				  *)
  AN_AsyncPkt	 = 007000004H ; (* Unexpected packet received		  *)
  AN_FreeVec	 = 007000005H ; (* Freevec failed			  *)
  AN_DiskBlkSeq	 = 007000006H ; (* Disk block sequence error		  *)
  AN_BitMap	 = 007000007H ; (* Bitmap corrupt			  *)
  AN_KeyFree	 = 007000008H ; (* Key already free			  *)
  AN_BadChkSum	 = 007000009H ; (* Invalid checksum			  *)
  AN_DiskError	 = 00700000AH ; (* Disk Error				  *)
  AN_KeyRange	 = 00700000BH ; (* Key out of range			  *)
  AN_BadOverlay	 = 00700000CH ; (* Bad overlay				  *)
  AN_BadInitFunc = 00700000DH ; (* Invalid init packet for cli/shell	  *)
  AN_FileReclosed= 00700000EH ; (* A filehandle was closed more than once *)

(*------ ramlib.library -----*)
  AN_RAMLib	 = 008000000H ;
  AN_BadSegList	 = 008000001H ;	(* no overlays in library seglists *)

(*------ icon.library -------*)
  AN_IconLib	 = 009000000H ;

(*------ expansion.library -----*)
  AN_ExpansionLib     = 00A000000H ;
  AN_BadExpansionFree = 00A000001H ; (* freeed free region *)

(*------ diskfont.library ------*)
  AN_DiskfontLib = 00B000000H ;

(*------ audio.device ----------*)
  AN_AudioDev	 = 010000000H ;

(*------ console.device --------*)
  AN_ConsoleDev	 = 011000000H ;
  AN_NoWindow	 = 011000001H ;	(* Console can't open initial window *)

(*------ gameport.device -------*)
  AN_GamePortDev = 012000000H ;

(*------ keyboard.device -------*)
  AN_KeyboardDev = 013000000H ;

(*------ trackdisk.device ------*)
  AN_TrackDiskDev = 014000000H ;
  AN_TDCalibSeek  = 014000001H ; (* calibrate: seek error      *)
  AN_TDDelay	  = 014000002H ; (* delay: error on timer wait *)

(*------ timer.device ---------*)
  AN_TimerDev	 = 015000000H ;
  AN_TMBadReq	 = 015000001H ; (* bad request			    *)
  AN_TMBadSupply = 015000002H ; (* power supply -- no 50/60Hz ticks *)

(*------ cia.resource ---------*)
  AN_CIARsrc	 = 020000000H ;

(*------ disk.resource --------*)
  AN_DiskRsrc	 = 021000000H ;
  AN_DRHasDisk	 = 021000001H ;	(* get unit: already has disk *)
  AN_DRIntNoAct	 = 021000002H ;	(* interrupt: no active unit  *)

(*------ misc.resource --------*)
  AN_MiscRsrc	 = 022000000H ;

(*------ bootstrap --------*)
  AN_BootStrap	 = 030000000H ;
  AN_BootError	 = 030000001H ;	(* boot code returned an error *)

(*------ Workbench --------*)
  AN_Workbench		= 031000000H ;
  AN_NoFonts		= 0B1000001H ;
  AN_WBBadStartupMsg1	= 031000001H ;
  AN_WBBadStartupMsg2   = 031000002H ;
  AN_WBBadIOMsg		= 031000003H ; (* Hacker code?    *)
  AN_WBReLayoutToolMenu	= 0B1010009H ; (* GadTools broke? *)

(*------ DiskCopy ---------*)
  AN_DiskCopy	 = 032000000H ;

(*------ toolkit for Intuition --------*)
  AN_GadTools	 = 033000000H ;

(*------ System utility library --------*)
  AN_UtilityLib	 = 034000000H ;

(*------ For use by any application that needs it -------*)
  AN_Unknown	 = 035000000H ;

END Alerts.
